UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cJgh2RYGorZ9Cp4r7itM2lTIq/ZL4dK1UWNkyHeYHBU='
WHERE
key_id = '0c86a559c5092fcb01201fe708b5b5dcb5bce8f6e9cb9b4159453e9e3c3f1173'
AND (
token = 'cJgh2RYGorZ9Cp4r7itM2lTIq/ZL4dK1UWNkyHeYHBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)