UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GdOgU+VYB/lnmtNvX5klJDqPB+WOX+wjKeHV80KLE1I='
WHERE
key_id = 'b8508a2648139fafb7bed66717c3735df57a5d776cd5e6306bce13060efe1c24'
AND (
token = 'GdOgU+VYB/lnmtNvX5klJDqPB+WOX+wjKeHV80KLE1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)