UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lRrr5dbp48sbgJMl1FWTKN+EfqaEB+8pkLMUzO2OjGQ=' 
WHERE 
  key_id = '96e3b8f56b7fdd5f306e6fbe19307bcd57b4e34e0fb11f5048662b42042252ba' 
  AND (
    token = 'lRrr5dbp48sbgJMl1FWTKN+EfqaEB+8pkLMUzO2OjGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024