UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+0ujheTBbYNaYG7NBoLcbQpV8Q7n30YjwATiPzJ4b34='
WHERE
key_id = '2a2ee19e6825dbcbfb3add583efa4e1ee5781db7d9f56a084df2710ba73560f9'
AND (
token = '+0ujheTBbYNaYG7NBoLcbQpV8Q7n30YjwATiPzJ4b34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)