UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZTepm59XtUFNDjsj8hQftrrcVlbM1zM860MI81d9/Js=' 
WHERE 
  key_id = '577faa4f3af3d1bd019960fdb23899a514a6457e3095c1cfe69200a3b75facbb' 
  AND (
    token = 'ZTepm59XtUFNDjsj8hQftrrcVlbM1zM860MI81d9/Js=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020