UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ggZnNT8LhKHSEygXnBaKYptq3KfwpXedOPp01krfBZw='
WHERE
key_id = 'c8cb422d5aed5cb2ec4c73950c9ec326db4acbefbc7bfd2670c706646852d341'
AND (
token = 'ggZnNT8LhKHSEygXnBaKYptq3KfwpXedOPp01krfBZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)