UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+/ExOVWjLCFvX3+gOhlkIrBGzIKE+j9XeKDo3q3nWm8=' 
WHERE 
  key_id = '0c39809280258af3c7bcadb1c64ef0812c0ebec8a79d931fc0bb4f5e85d54e5d' 
  AND (
    token = '+/ExOVWjLCFvX3+gOhlkIrBGzIKE+j9XeKDo3q3nWm8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044