UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'de8UlM1+EfIYyCcN1SkI9WSCpV8i1TvBt9ciHWvjUdM='
WHERE
key_id = '8b747cbaa138403042d8e7d59e4e9acfe74a78ed8dd59e254b3e70b8897261d7'
AND (
token = 'de8UlM1+EfIYyCcN1SkI9WSCpV8i1TvBt9ciHWvjUdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)