UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Po54tZvnSrkcEnsTJvQFBBkwp31qybkqyCh5ZlEusdY='
WHERE
key_id = 'b1cf386db839869f14565173183dfb37efd5f8ca46515e580c7f848e949f6fb9'
AND (
token = 'Po54tZvnSrkcEnsTJvQFBBkwp31qybkqyCh5ZlEusdY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)