UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jr3f5N9mabVlu+qBAQxG7EJbpf//5FC3Mr7z9Sub92Y=' 
WHERE 
  key_id = '411390a3d05f70ac495cd648a13ead1d2fb802c4b35f224f31cc6d399d92ea07' 
  AND (
    token = 'Jr3f5N9mabVlu+qBAQxG7EJbpf//5FC3Mr7z9Sub92Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036