UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oro16OHcBSMU8pn/8kPLkJPwqbLzd1Rskqjc9eHrJDE='
WHERE
key_id = 'a847f26bff78cc05e2d065e8e975d480ccc9ea61e6ea250038f222985bce189b'
AND (
token = 'Oro16OHcBSMU8pn/8kPLkJPwqbLzd1Rskqjc9eHrJDE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)