UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GfEcwdXfbP0zFysOQ1hTdfGopfT6PIUDjOvL5wKpsQM=' 
WHERE 
  key_id = '1d75fef0ef5d4c3bf956bc1b7fb3cea248fb76cf1a03296e056ef6c621062607' 
  AND (
    token = 'GfEcwdXfbP0zFysOQ1hTdfGopfT6PIUDjOvL5wKpsQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038