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