UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yrK3O1+kM/ACwKYkeQjehtE/P4o6Y4lv7qU3hPwdKIM=' 
WHERE 
  key_id = 'ec66f85b748de71231f69bcc00bf179c8e5e9b754fecd19b8eacbd193d211702' 
  AND (
    token = 'yrK3O1+kM/ACwKYkeQjehtE/P4o6Y4lv7qU3hPwdKIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040