UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IeNWfjNDE1UuBL3vJDNpDO2xHPgUIMQV6GmbCVzZic8='
WHERE
key_id = 'e2a684ef8d9d1c7914732f6bdcb913bfaa462705994f9ac6014e4288d40b0530'
AND (
token = 'IeNWfjNDE1UuBL3vJDNpDO2xHPgUIMQV6GmbCVzZic8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)