UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MxO5kFNO1z2uEA54jq1wBcuOfvDhrhlXSv7llgsO/T8='
WHERE
key_id = '837b5ff4fb109a9df2809bdef36797583693f30336ac8100c463fa8ed860c8ad'
AND (
token = 'MxO5kFNO1z2uEA54jq1wBcuOfvDhrhlXSv7llgsO/T8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)