UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7UsIADjrI9EVtDc2BqKWd9c61848GAOslx9gZpmrfc0='
WHERE
key_id = '4dd08750686ae30476b60a0b2c7404abb046ba11326c1fb9ea4c607a1fe7da89'
AND (
token = '7UsIADjrI9EVtDc2BqKWd9c61848GAOslx9gZpmrfc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)