UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Drb6H+ukRxejmT0NeE9kSTcwMSWVgrpu9JmuvzeNUbc='
WHERE
key_id = 'bb421fe2f74bdc47286b27522c617c283a5d0466369ff84a92d33926a140fc08'
AND (
token = 'Drb6H+ukRxejmT0NeE9kSTcwMSWVgrpu9JmuvzeNUbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)