UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vaZfS27uVYYCBPV/tFOx6F4pgjNbjeQ8By6UjlJ/fyQ=' 
WHERE 
  key_id = '2b0f19f256b49d1c6f28bd477b460c4f81d59a127f44e48353683de664c1c20d' 
  AND (
    token = 'vaZfS27uVYYCBPV/tFOx6F4pgjNbjeQ8By6UjlJ/fyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023