UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D3CIfzWdz7zJXwJj75FELdwFj8XBPoUlYIzDGwmlgfY='
WHERE
key_id = '32cf0cdca9aba9871671e1c305076491f48c1d40fe2481a2cfa5fb2f3e982872'
AND (
token = 'D3CIfzWdz7zJXwJj75FELdwFj8XBPoUlYIzDGwmlgfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)