UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VU0wDQWldDfFF+XodhFpQapgu1FLRorZ2HGakOIvOv4=' 
WHERE 
  key_id = '98ce079684140f8c9a0946a80ad41de4f3e31b4ec92301829cd48beed2ca69cf' 
  AND (
    token = 'VU0wDQWldDfFF+XodhFpQapgu1FLRorZ2HGakOIvOv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038