UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nTtGSFDLeZ5+oSggZRtCljuCqYfxxR8EjTBJRY4oPxI='
WHERE
key_id = '63129429efbbe520d6ea796bc1a5bf2ce0785561f2a4eaa07adf4e5e383f007c'
AND (
token = 'nTtGSFDLeZ5+oSggZRtCljuCqYfxxR8EjTBJRY4oPxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)