UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3jm4tsS5pkaOxuyfRbp90cK8taigVogS/yPTZlOqLTI='
WHERE
key_id = '18d4034d16b961de55636e469bea3d503746128941844f20ec0829593c60be43'
AND (
token = '3jm4tsS5pkaOxuyfRbp90cK8taigVogS/yPTZlOqLTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)