UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BW6yMOzpR/ObjjjIDSZ8pFI1xww5Dfvs3XX0qP2Y2kA=' 
WHERE 
  key_id = '82121e00bea9887f0c44f07e03454f7398774f3d94d684eb7fc014d41833cebe' 
  AND (
    token = 'BW6yMOzpR/ObjjjIDSZ8pFI1xww5Dfvs3XX0qP2Y2kA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030