UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VVqo5pyxXMD6OTjy18Mnu2Acle4fD2FKgBkZuScX1cE=' 
WHERE 
  key_id = '1c3dc50eb35e63e1cd0b3adadfbc211715e64c6bb5cd4b4f28ec8f1d621f594b' 
  AND (
    token = 'VVqo5pyxXMD6OTjy18Mnu2Acle4fD2FKgBkZuScX1cE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053