UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3F0b1XuRxqL27jRQUqh4hT2fI2jMJPLp4a3BS3/2nUw=' 
WHERE 
  key_id = 'e3ad52348dc5ca562e74d2a18a8cadf2c3b531a99417f2cff087dff56bb3acbd' 
  AND (
    token = '3F0b1XuRxqL27jRQUqh4hT2fI2jMJPLp4a3BS3/2nUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026