UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3AJcMqBS26vtcoO403fUdNh8xdhJLJDR5uMNKyx96f8=' 
WHERE 
  key_id = '92f4a075a8390e9d15a7afe3273d4d8626156a205928e90de806af1bc9abe636' 
  AND (
    token = '3AJcMqBS26vtcoO403fUdNh8xdhJLJDR5uMNKyx96f8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026