UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mj/EcGs6K6hv0kHEmSu/sRtd4GzVcEagQEyC2k30njQ=' 
WHERE 
  key_id = '25022b25818c67e45028ce96f7800fad9ab776679379ee1b2baf6969366d0e56' 
  AND (
    token = 'Mj/EcGs6K6hv0kHEmSu/sRtd4GzVcEagQEyC2k30njQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022