UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YrIS0MfivmOjauod+bjeR+RjINj2Q5yenjKlXevDzZc='
WHERE
key_id = '9f4436161d48b082bd1c3ed3296fffc9af64554aebb97119605d7fedc777e0f6'
AND (
token = 'YrIS0MfivmOjauod+bjeR+RjINj2Q5yenjKlXevDzZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)