UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yY5+n40QiqpScnDvisa66ymWAJwPITwYgrwBGsoJF9c='
WHERE
key_id = 'd984beb6131cb355433cc065fa636dbddcfc6861c916f57eaec19b3eae4ddb73'
AND (
token = 'yY5+n40QiqpScnDvisa66ymWAJwPITwYgrwBGsoJF9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)