UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ytesLL22O1oBi38iTwmW+lhnKr6dN7C0XrISF/w2j/4='
WHERE
key_id = '5d412211123f00ba889be2ce825af8f1b8efec4f68a7f740fac6e55b9df0e752'
AND (
token = 'ytesLL22O1oBi38iTwmW+lhnKr6dN7C0XrISF/w2j/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)