UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EnDH/geLHQ4ZtxCOEAGC586MuqG7z4ML+vJCzrAhxOU='
WHERE
key_id = '12a0140a5825cc36b45d01cab828450fa231ec3dad60c80dd503f89a8a205d44'
AND (
token = 'EnDH/geLHQ4ZtxCOEAGC586MuqG7z4ML+vJCzrAhxOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)