UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sIU4nZIXOEzDMaCAyQDmMdiQrvq/5jq58+kylLKLPcY='
WHERE
key_id = '48c123947cde3bd1a8eb0f2fde7fb3e8a787984efbf3fb6a299c4ebcf98130a5'
AND (
token = 'sIU4nZIXOEzDMaCAyQDmMdiQrvq/5jq58+kylLKLPcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)