UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D/EcdBG9a92ap21V0jiG6oI47WsHdAkRKhHU2AHu8vo='
WHERE
key_id = '2d4abe3621bce62a9c0bc74c65d96d7508371067246bd07308fac36b86a3a772'
AND (
token = 'D/EcdBG9a92ap21V0jiG6oI47WsHdAkRKhHU2AHu8vo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)