UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YiGlzjlZHBkQfQwGkUvDcsF/FygL4aJjREzXr05gttc='
WHERE
key_id = '548f63d9709867272bf3ec191ef0204614c2558cd31dce5fb8e559b841e33cb8'
AND (
token = 'YiGlzjlZHBkQfQwGkUvDcsF/FygL4aJjREzXr05gttc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)