UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hj7TY/Aq2BYDVPObUEMaOv+21ytUnRh3RUIkOhjVIrw='
WHERE
key_id = 'b50ad537bfa73c3c7d995d519e4cc1b756d322a5bcaafe43bc192bd493d0cf45'
AND (
token = 'Hj7TY/Aq2BYDVPObUEMaOv+21ytUnRh3RUIkOhjVIrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)