UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cz32q82v8MUjzSTRjK/5UBS2BmrfsHnB0yjsKwZ5f1c=' 
WHERE 
  key_id = '2633ac50bd2294969115d93ae9df3745ee30af44476257185453ae38cac59f7e' 
  AND (
    token = 'Cz32q82v8MUjzSTRjK/5UBS2BmrfsHnB0yjsKwZ5f1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025