UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Kdnaey/OKpwcLsgdrGheIzn2XZyR9SobgwJXvcpttc='
WHERE
key_id = '003cb06267e5a3d001f554d0894021e26588674a59597bfea56896b8863e80e8'
AND (
token = '9Kdnaey/OKpwcLsgdrGheIzn2XZyR9SobgwJXvcpttc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)