UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LUlXhjwUnDGBZYuZHNZaPgCFbRtsApsNpzDgNiuuZxw=' 
WHERE 
  key_id = 'd01b8e101a6b3cce59eca14232ab0be1c24f05804c45838f3caa1b4d4c71208f' 
  AND (
    token = 'LUlXhjwUnDGBZYuZHNZaPgCFbRtsApsNpzDgNiuuZxw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021