UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DVfEYE4nQw9BeUM+WaNoCtj98/X/KDW+EUnRm3kmyJ8='
WHERE
key_id = '0465273fd69ce1f5e2dd9954701cf6ac30ea4629d5f548f5144a085a1ee4d92d'
AND (
token = 'DVfEYE4nQw9BeUM+WaNoCtj98/X/KDW+EUnRm3kmyJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)