UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JeX97FH/PBUHW7WNLNKW3uQGnvPx+NkQOgoGHHKUV5o=' 
WHERE 
  key_id = 'ff05241d2a9f4282c31e34f68a5b14df5d2ef79097383e7ee30f98a7185f0ef2' 
  AND (
    token = 'JeX97FH/PBUHW7WNLNKW3uQGnvPx+NkQOgoGHHKUV5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031