UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pL1BbeaK6OYI/GwJyS2tubID0KdH2QJblVtwLzYXV48=' 
WHERE 
  key_id = 'ec5fc4e3a03ed53ddcb8e679a5ad87d144f25545dfcdaceb9e7b7e1238a44eb0' 
  AND (
    token = 'pL1BbeaK6OYI/GwJyS2tubID0KdH2QJblVtwLzYXV48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049