UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pjtINxpZieUJ+G14Jq5iP9vDSX3SWVcRH13ws9+EfMU=' 
WHERE 
  key_id = '13d662477ac55cb4e503c7499be2cfe5f84c9ceaf9ae1ee6a115dc46b6abdb32' 
  AND (
    token = 'pjtINxpZieUJ+G14Jq5iP9vDSX3SWVcRH13ws9+EfMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035