UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O7ecQ/HTutTqnJrWWNef069uJGick+RQ/fQoQtDbgPA=' 
WHERE 
  key_id = '79c0b7d985b1130c40c606d46966c5a50ac575bcfb1d7daab96cf34d4abcf1df' 
  AND (
    token = 'O7ecQ/HTutTqnJrWWNef069uJGick+RQ/fQoQtDbgPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025