UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bDSz5em/8FM1r+ZR0HnVBkVC6rxlWJbSXKBm75QGpx4='
WHERE
key_id = '194516fcf66ae12d68f6689b90b05003c5ba0169cb7239a076a7f3d3a21ac140'
AND (
token = 'bDSz5em/8FM1r+ZR0HnVBkVC6rxlWJbSXKBm75QGpx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)