UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wPI1ohbeAEYUX4PGzRdoXe9wEnhl3BGMGYQ1Me0kgIw='
WHERE
key_id = '08fca2a55359b5ec7b439e5411eb506d16072709f4cbf6c613b4906354b559d3'
AND (
token = 'wPI1ohbeAEYUX4PGzRdoXe9wEnhl3BGMGYQ1Me0kgIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)